<template>
    <div class="container">

        <!-- 基本搜索+功能按钮 -->
        <!-- <el-form ref="searchForm1" :inline="true" :model="searchForm" size="medium" label-width="">
            <el-card class="table_tool_bar_wrap" shadow="never">
                <div class="base_wrap">
                    <div class="left">
                        <el-form-item label="关键字搜索" prop="keyword">
                            <el-input placeholder="" v-model="searchForm.keyword" clearable/>
                        </el-form-item>
                        <el-button @click="handleSearch" type="primary" size="medium">搜索</el-button>
                        <el-button @click="handleReset" type="info" plain size="medium">重置</el-button>
                        <el-button type="text" size="medium" @click="searchFlag = !searchFlag">
                            高级搜索<i class="el-icon--right" :class="searchFlag?'el-icon-arrow-down':'el-icon-arrow-up'"></i>
                        </el-button>
                    </div>

                    <div class="right">
                        <el-button @click="handleAddOrUpdateVisible()" type="primary" size="medium" icon="el-icon-plus">新增</el-button>
                        <el-button @click="handleDelete()" type="danger" size="medium" icon="el-icon-delete" :disabled="selectionRows.length == 0">删除</el-button>
                    </div>
                </div>
            </el-card>
        </el-form> -->

        <!-- 高级搜索 -->
        <!-- <el-form ref="searchForm2" :inline="true" :model="searchForm" size="medium" label-width="120px">
            <el-collapse-transition>
                <el-card class="where_wrap" shadow="never" v-if="!searchFlag">
                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="代理商ID" prop="agent">
                                <el-input placeholder="" v-model="searchForm.agent" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="会员openid" prop="openid">
                                <el-input placeholder="" v-model="searchForm.openid" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="会员昵称" prop="nickname">
                                <el-input placeholder="" v-model="searchForm.nickname" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="登录账号" prop="username">
                                <el-input placeholder="" v-model="searchForm.username" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="登录密码" prop="password">
                                <el-input placeholder="" v-model="searchForm.password" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="安全码" prop="secret">
                                <el-input placeholder="" v-model="searchForm.secret" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="推荐会员ID" prop="refereeMemberId">
                                <el-input placeholder="" v-model="searchForm.refereeMemberId" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="推荐会员昵称" prop="refereeMemberName">
                                <el-input placeholder="" v-model="searchForm.refereeMemberName" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="推荐会员微信openid" prop="refereeMemberOpenId">
                                <el-input placeholder="" v-model="searchForm.refereeMemberOpenId" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="会员注册来源：1->微信商城，2->小程序商城，3->微信营销活动，4->小程序营销活动，5->安卓App，6->苹果App" prop="regSrc">
                                <el-input placeholder="" v-model="searchForm.regSrc" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="手机号" prop="mobile">
                                <el-input placeholder="" v-model="searchForm.mobile" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="邮箱" prop="email">
                                <el-input placeholder="" v-model="searchForm.email" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="头像" prop="avatar">
                                <el-input placeholder="" v-model="searchForm.avatar" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="会员等级ID" prop="levelId">
                                <el-input placeholder="" v-model="searchForm.levelId" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="性别：0->保密，1->男，2->女" prop="sex">
                                <el-input placeholder="" v-model="searchForm.sex" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="生日" prop="birth">
                                <el-input placeholder="" v-model="searchForm.birth" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="积分" prop="integration">
                                <el-input placeholder="" v-model="searchForm.integration" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="成长值" prop="growth">
                                <el-input placeholder="" v-model="searchForm.growth" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="会员标记：1->内部员工，2->外部分销" prop="memberFlag">
                                <el-input placeholder="" v-model="searchForm.memberFlag" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="会员类型：1->游客，2->普通会员，3->VIP会员，4->业务代理" prop="type">
                                <el-input placeholder="" v-model="searchForm.type" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="会员推荐码" prop="code">
                                <el-input placeholder="" v-model="searchForm.code" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="会员所在城市" prop="city">
                                <el-input placeholder="" v-model="searchForm.city" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="会员有效期-开始日期" prop="sdate">
                                <el-input placeholder="" v-model="searchForm.sdate" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="会员有效期-结束日期" prop="edate">
                                <el-input placeholder="" v-model="searchForm.edate" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="启用状态：1->正常，2->禁用" prop="status">
                                <el-input placeholder="" v-model="searchForm.status" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="创建时间" prop="ctime">
                                <el-input placeholder="" v-model="searchForm.ctime" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="最后更新时间" prop="utime">
                                <el-input placeholder="" v-model="searchForm.utime" clearable/>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="状态" prop="status">
                                <el-select placeholder="" v-model="searchForm.status" clearable>
                                    <el-option label="正常" value="1"></el-option>
                                    <el-option label="禁用" value="2"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-card>
            </el-collapse-transition>
        </el-form> -->

        <!-- 基本搜索+功能按钮 -->
        <el-form ref="searchForm1" :inline="true" :model="searchForm" size="medium" label-width="70px">
            <div class="table_tool_bar_wrap">
                <div class="base_wrap mb10">
                    <div class="left">
                        <el-form-item label="快捷搜索" prop="keyword">
                            <el-input placeholder="" v-model="searchForm.keyword" clearable size="small"/>
                        </el-form-item>
                        <el-button @click="handleSearch" type="primary" size="small">搜索</el-button>
                        <el-button @click="handleReset" type="info" plain size="small">重置</el-button>
                        <!-- <el-button type="text" size="medium" @click="searchFlag = !searchFlag">
                            高级搜索<i class="el-icon--right" :class="searchFlag?'el-icon-arrow-down':'el-icon-arrow-up'"></i>
                        </el-button> -->
                    </div>
                    <div class="right">
                        <el-button @click="handleAddOrUpdateVisible()" type="primary" size="medium" icon="el-icon-plus">新增</el-button>
                        <el-button @click="handleDelete()" type="danger" size="medium" icon="el-icon-delete" :disabled="selectionRows.length == 0">删除</el-button>
                    </div>
                </div>
            </div>
        </el-form>

        <!-- 高级搜索 -->
        <el-form class="mt10" ref="searchForm2" :inline="true" :model="searchForm" v-show="!searchFlag" size="medium" label-width="70px">
            <div class="table_tool_bar_wrap">
                <div class="base_wrap mb10">
                    <div class="left">
                        <el-form-item label="会员名称" prop="memberUsername">
                            <el-input placeholder="" v-model="searchForm.memberUsername" clearable size="small"/>
                        </el-form-item>

                        <el-form-item label="代理商" prop="deliverType">
                            <el-select v-model="searchForm.deliverType" placeholder="请选择">
                                <el-option label="送货上门" :value="0" />
                                <el-option label="到店自提" :value="1" />
                            </el-select>
                        </el-form-item>
                    </div>
                </div>
            </div>
        </el-form>

        <!-- 表格 -->
        <el-table
            ref="table"
            size="medium"
            height="500"
            empty-text="暂无数据"
            element-loading-text="给我一点时间"
            fit border highlight-current-row
            :stripe="stripe"
            v-loading="loading"
            :data="dataList"
            @selection-change="handleSelection">

            <el-table-column type="selection" width="55" prop="selection" v-if="isHideColumn('selection')" align="center"></el-table-column>
            <!-- <el-table-column label="序号" type="index" prop="index" v-if="isHideColumn('index')" width="60" align="center" /> -->
            <el-table-column label="会员名" prop="nickname" v-if="isHideColumn('nickname')" align="left" show-overflow-tooltip/>
            <el-table-column label="性别" align="center">
                <template slot-scope="scope">
                    {{scope.row.sex | formatSex}}
                </template>
            </el-table-column>
            <el-table-column label="推荐会员" prop="refereeMemberName" v-if="isHideColumn('refereeMemberName')" align="left" show-overflow-tooltip/>
            <el-table-column label="手机号" prop="mobile" v-if="isHideColumn('mobile')" align="left" width="150" show-overflow-tooltip/>
            <el-table-column label="会员等级" prop="level" v-if="isHideColumn('level')">
                <template slot-scope="scope">
                    <span v-if="scope.row.level">{{scope.row.level.name}}</span>
                    <span v-else>-</span>
                </template>
            </el-table-column>
            <el-table-column label="标记" align="center">
                <template slot-scope="scope">
                    {{scope.row.memberFlag | formatFlag}}
                </template>
            </el-table-column>
            <el-table-column label="推荐码" prop="code" v-if="isHideColumn('code')" align="left" show-overflow-tooltip/>
            <el-table-column label="所属代理" prop="agent">
                <template slot-scope="scope">
                    <span v-if="scope.row.agent">{{scope.row.agent.name}}</span>
                    <span v-else>-</span>
                </template>
            </el-table-column>
            <el-table-column label="所在城市" width="200px" show-overflow-tooltip>
                <template slot-scope="scope">
                    {{scope.row.province}},{{scope.row.city}},{{scope.row.district}}
                </template>
            </el-table-column>
            <el-table-column label="会员有效期" align="center" width="190px">
                <template slot-scope="scope">
                    <!-- <span v-if="scope.row.type == 2 || scope.row.type == 3 || scope.row.type == 8"> -->
                        {{scope.row.expire}}
                    <!-- </span> -->
                    <!-- <span v-else>-</span> -->
                </template>
            </el-table-column>
            <el-table-column label="状态" align="center" width="100px">
                <template slot-scope="scope">
                    <el-switch
                        v-model="scope.row.status"
                        active-color="#13ce66"
                        inactive-color="#ff4949"
                        :active-value="1"
                        :inactive-value="0"
                        @change="handleChangeStatus(scope.row)">
                    </el-switch>
                </template>
            </el-table-column>
            <el-table-column label="创建时间" prop="ctime" v-if="isHideColumn('ctime')" align="left" show-overflow-tooltip/>

            <el-table-column label="操作" prop="btn" v-if="isHideColumn('btn')" width="200px" align="left" fixed="right">
                <template slot-scope="scope">
                    <el-button @click="handleAddOrUpdateVisible(scope.row.id)" type="text" size="small">编辑</el-button>
                    <el-button @click="handleDelete(scope.row)" type="text" size="small">删除</el-button>
                    <el-button @click="handleCouponVisible(scope.row)" type="text" size="small">优惠券</el-button>
                    <!-- <el-dropdown @command="handleCommand">
                        <span class="el-dropdown-link">
                            更多<i class="el-icon-arrow-down el-icon--right"></i>
                        </span>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row, 'remarks')">指定代理商</el-dropdown-item>
                            <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row, 'logistics')">物流跟踪</el-dropdown-item>
                            <el-dropdown-item v-if="scope.row.status == 0 || scope.row.status == 4" :command="beforeHandleCommand(scope.$index, scope.row, 'deleted')">删除订单</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown> -->
                </template>
            </el-table-column>

        </el-table>

        <!-- 分页 -->
        <TablePagination
            :total.sync="total"
            :page.sync="searchForm.page"
            :limit.sync="searchForm.limit"
            @handleSizeChange="handleSizeChange"
            @handleCurrentChange="handleCurrentChange"/>

        <!-- 弹窗, 新增 / 修改 -->
        <AddOrUpdate ref="addOrUpdate" @refreshDataList="getDataList"></AddOrUpdate>

        <!-- 优惠券 -->
        <el-dialog
            width="60%"
            title="优惠券"
            :visible.sync="coupon.dialogVisible">

                <el-divider content-position="left">已领取优惠券</el-divider>
                <!-- 表格 -->
                <el-table
                    ref="table"
                    size="medium"
                    empty-text="暂无数据"
                    element-loading-text="给我一点时间"
                    fit border highlight-current-row
                    :stripe="stripe"
                    v-loading="loading"
                    :data="dataListMemberCoupon">

                    <el-table-column type="selection" width="55" prop="selection" align="center"></el-table-column>
                    <el-table-column label="优惠卷名字" prop="umsCoupon.couponName" align="left" show-overflow-tooltip/>
                    <el-table-column label="金额" prop="umsCoupon.amount" align="left" show-overflow-tooltip/>
                    <!-- <el-table-column label="每人限领张数" prop="perLimit" align="left" show-overflow-tooltip/> -->
                    <el-table-column label="使用门槛（元）" prop="umsCoupon.minPoint" align="left" show-overflow-tooltip/>
                    <!-- <el-table-column label="备注" prop="note" align="left" show-overflow-tooltip/> -->
                    <!-- <el-table-column label="领取数量" prop="receiveCount" align="left" show-overflow-tooltip/> -->
                    <el-table-column label="状态" align="center" width="80px">
                        <template slot-scope="scope">
                            <el-tag type="danger" size="small" v-if="scope.row.umsCouponMemberRelation.useStatus === 1">已使用</el-tag>
                            <el-tag type="success" size="small" v-else>未使用</el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column label="操作" align="center" width="80px">
                        <template slot-scope="scope">
                            <el-button @click="handleDelMemberCoupon(scope.row.umsCouponMemberRelation.id)" v-if="scope.row.umsCouponMemberRelation.useStatus === 0" type="text" size="small">删除</el-button>

                        </template>
                    </el-table-column>

                </el-table>

                <el-divider content-position="left">可领取优惠券</el-divider>
                <!-- 表格 -->
                <el-table
                    ref="table"
                    size="medium"
                    empty-text="暂无数据"
                    element-loading-text="给我一点时间"
                    fit border highlight-current-row
                    :stripe="stripe"
                    v-loading="loading"
                    :data="dataListCoupon"
                    @selection-change="handleSelectionCoupon">

                    <el-table-column type="selection" width="55" prop="selection" align="center"></el-table-column>
                    <el-table-column label="优惠卷名字" prop="couponName" align="left" show-overflow-tooltip/>
                    <el-table-column label="数量" prop="num" align="left" show-overflow-tooltip/>
                    <el-table-column label="金额" prop="amount" align="left" show-overflow-tooltip/>
                    <!-- <el-table-column label="每人限领张数" prop="perLimit" align="left" show-overflow-tooltip/> -->
                    <el-table-column label="使用门槛（元）" prop="minPoint" align="left" show-overflow-tooltip/>
                    <!-- <el-table-column label="备注" prop="note" align="left" show-overflow-tooltip/> -->
                    <el-table-column label="已使用数量" prop="useCount" align="left" show-overflow-tooltip/>
                    <el-table-column label="领取数量" prop="receiveCount" align="left" show-overflow-tooltip/>
                    <el-table-column label="发布状态" align="center" width="80px">
                        <template slot-scope="scope">
                            <el-tag type="success" size="small" v-if="scope.row.publish === 1">已发布</el-tag>
                            <el-tag type="danger" size="small" v-else>未发布</el-tag>
                        </template>
                    </el-table-column>

                    <el-table-column label="添加数量">
                        <template slot-scope="scope">
                            <el-input v-model="scope.row.addNum"></el-input>
                        </template>
                    </el-table-column>
                </el-table>

            <div slot="footer" class="dialog-footer">
                <el-button @click="coupon.dialogVisible = false">关 闭</el-button>
                <el-button @click="handleCoupon" type="primary" :submitLoading="submitLoading">提 交</el-button>
            </div>
        </el-dialog>

    </div>
</template>

<script>
import TableMixin from '@/mixin/TableMixin'
import TableTools from '@/views/components/table/table-tools'
import TablePagination from '@/views/components/table/table-pagination'
import AddOrUpdate from './add-or-update-dialog'
export default {
    mixins: [TableMixin],
    components: {
        TableTools,
        TablePagination,
        AddOrUpdate
    },

    props: {
        params: {
            type: Object
        }
    },

    data() {
        return {
            dataList: [],
            total: 0,
            loading: false,
            selectionRows: [],
            selectionRowsCoupon: [],
            searchFlag: true,
            searchForm: {
                page: 1,
                limit: 10,
                sortColumns: null,
                sortType: null,
                keyword: null,
                agent: null,
                openid: null,
                nickname: null,
                username: null,
                password: null,
                secret: null,
                refereeMemberId: null,
                refereeMemberName: null,
                refereeMemberOpenId: null,
                regSrc: null,
                mobile: null,
                email: null,
                avatar: null,
                levelId: null,
                sex: null,
                birth: null,
                integration: null,
                growth: null,
                memberFlag: null,
                type: null,
                code: null,
                city: null,
                sdate: null,
                edate: null,
                status: null,
                ctime: null,
                utime: null
            },

            submitLoading: false,

            memberId: null,

            dataListMemberCoupon: [],
            dataListCoupon: [],
            // 优惠券
            coupon: {
                dialogVisible: false,
                id: null,
                couponVos: []
            },
        }
    },

    created() {
        // tabs 组件传入的参数
        let { type } = this.params

        this.searchForm.type = type
    },

    mounted() {
        this.$nextTick(() => {
            this.getDataList()
        })
    },

    methods: {

        /**
         * 新增或编辑
         */
        handleAddOrUpdateVisible(id) {
            // 表单窗口
            this.$nextTick(() => {
                this.$refs.addOrUpdate.init(id)
            })
        },

        /**
         * 删除
         */
        async handleDelete(row) {
            let ids = []
            if (row) {
                ids.push(row.id)
            }
            if(this.selectionRows) {
                this.selectionRows.filter((item, index) => {
                    ids.push(item.id)
                })
            }
            if (ids.length <= 0) {
                this.$notify({ title: '提示', message: '请选择需要删除的记录！', type: 'info' });
            } else {
                const confirm = await this.$confirm('确定要删除？', '提示', { type: 'warning' }).catch(() => {})
                if(confirm) {
                    const res = await this.$http({
                        url: '/mall/umsmember/delete',
                        method: 'POST',
                        data: ids
                    })
                    if (this.ResultMessage(res)) {
                        this.getDataList()
                    }
                }
            }
        },

        /**
         * 获取表格数据
         */
        async getDataList() {
            this.loading = true
            const res = await this.$http({
                url: '/mall/umsmember/page',
                method: 'GET',
                params: this.searchForm
            })
            if (this.ResultMessage(res, false)) {
                this.dataList = res.data.records || []
                this.total = res.data.total
            }
            this.loading = false
        },

        handleCouponVisible(row) {
            this.coupon.id = row.id
            this.coupon.couponVos = []
            this.coupon.dialogVisible = true

            this.getDataListMemberCoupon(row.id)
            this.getDataListCoupon()
        },

        async handleCoupon() {
            this.selectionRowsCoupon.forEach(item=>this.coupon.couponVos.push({id: item.id, num: item.addNum}))

            this.submitLoading = true
            const res = await this.$http({
                url: `/mall/umsmember/addCoupon`,
                method: 'POST',
                data: this.coupon
            })
            if (this.ResultMessage(res)) {
                this.submitLoading = false
                this.coupon.dialogVisible = false
            } else {
                this.submitLoading = false
            }
        },

        /**
         * 获取表格数据
         */
        async getDataListMemberCoupon(id) {
            this.memberId = id
            this.loading = true
            const res = await this.$http({
                url: '/mall/umsmember/getUserCoupons/'+id,
                method: 'GET'
            })
            if (this.ResultMessage(res, false)) {
                this.dataListMemberCoupon = res.data || []
            }
            this.loading = false
        },

        /**
         * 删除会员优惠券
         */
        async handleDelMemberCoupon(id) {
            this.loading = true
            const res = await this.$http({
                url: '/mall/umscouponmemberrelation/delete',
                method: 'post',
                data: [id]
            })
            if (this.ResultMessage(res, false)) {
                this.getDataListMemberCoupon(this.memberId)
                this.getDataListCoupon()
            }
            this.loading = false
        },

        /**
         * 获取表格数据
         */
        async getDataListCoupon() {
            this.loading = true
            const res = await this.$http({
                url: '/mall/umscoupon/list',
                method: 'GET'
            })
            if (this.ResultMessage(res, false)) {
                this.dataListCoupon = res.data || []
            }
            this.loading = false
        },

        /**
         * el-dropdown 传入多参数
         */
        beforeHandleCommand(index, row, name){
            return { 'index': index, 'row': row, 'name': name }
        },
        /**
         * el-dropdown 更多操作
         */
        async handleCommand(command) {
            const { name, row } = command
            if (name === 'remarks') {
                this.handleRemarksOrderVisible(row)
            } else if(name === 'logistics') {
                this.handleLogisticsVisible(row)
            } else if(name === 'deleted') {
                this.handleDelete(row)
            }
        },

        /**
         * 开通/禁用
         */
        async handleChangeStatus(row) {
            const confirm = await this.$confirm('确定要'+(row.status == 0 ? '禁用' : '开通')+'？', '提示', { type: 'warning' }).catch(() => {})
            if(confirm) {
                this.loading = true
                await this.$http({
                    url: '/mall/umsmember/changeStatus/'+row.id+'/'+row.status,
                    method: 'GET'
                })
                this.loading = false
                this.getDataList()
            } else {
                row.status = row.status == 0 ? 1 : 0
            }
        },

        /**
         * 搜索
         */
        handleSearch() {
            this.getDataList()
        },
        /**
         * 重新加载数据表格
         */
        handleReload() {
            this.getDataList()
        },
        /**
         * 重置搜索表单
         */
        handleReset() {
            this.$refs.searchForm1.resetFields()
            this.$refs.searchForm2.resetFields()
        },

        /**
         * 多选
         */
        handleSelectionCoupon(selection) {
            this.selectionRowsCoupon = selection
        },





    },

    filters: {
        formatMemberType(value) {
            if (value === 1) {
                return '游客';
            } else if (value === 2) {
                return '普通会员';
            } else if (value === 3) {
                return 'VIP会员';
            } else if (value === 4) {
                return '业务代理';
            } else {
                return '-';
            }
        },
        formatFlag(value) {
            if (value === 1) {
                return '内部员工';
            } else if (value === 2) {
                return '外部分销';
            } else {
                return '-';
            }
        },
        formatSex(value) {
            if (value === 1) {
                return '男';
            } else if (value === 2) {
                return '女';
            } else {
                return '-';
            }
        },
    }

}
</script>

<style lang="scss" scoped>
.el-dropdown-link {
    cursor: pointer;
    color: #409EFF;
    font-size: 12px;
    margin-left: 10px;
}
.el-icon-arrow-down {
    font-size: 12px;
}
</style>
